package adavance.thread.lockbank;

/**
 * @author oldliu
 * @since 1.0
 */
public class Account {
    private String no;//账户
    private int money=0;//余额

    public Account(String no, int money) {
        this.no = no;
        this.money = money;
    }
    //存钱和取钱
    public void deposit(int m){
        this.money+=m;
    }
    //取钱:防止成负数
    public void withdraw(int m){
        this.money-=m;
    }
    public String getNo() {
        return no;
    }

    public int getMoney() {
        return money;
    }
}
